package com.lazy.book.service.system.impl;


import com.lazy.book.common.constant.GlobalConstant;
import com.lazy.book.common.entity.UserPermissionChangeMessage;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 *
 * @author lazy
 * @since 2025-09-05
 */
@Component
@RequiredArgsConstructor
public class RedisService {

  private final RedisTemplate<Object, Object> redisTemplate;

  /**
   * 发布Permission 变更消息
   *
   * @param message
   *            消息
   */
  public void sendPermissionChangeMsg(UserPermissionChangeMessage message) {
    redisTemplate.convertAndSend(GlobalConstant.CHANGE_PERMISSIONS_SIGNAL, message);
  }

}
